<?
include_once "accesscontrol.php";
include_once "../conn.php";


$q1 = "select * from job_work_experience where uname = \"$_SESSION[uname]\" order by WEn asc ";
$r2 = mysql_query($q1) or die(mysql_error());

$q3 = "select * from job_seeker_info where uname = \"$_SESSION[uname]\" ";
$r4 = mysql_query($q3) or die(mysql_error());
$a2 = mysql_fetch_array($r4);

echo "<br>";
while ($a1 = mysql_fetch_array($r2))
{
	
	echo "
	<form action=EditWorkExperience.php method=post>
	<table align=center width=460 border=1 bordercolor=black cellspacing=0 cellpadding=0 class=BlackText>
	<caption class=HeaderClass>
		Work experience $a1[WEn]
	<input type=submit name=submit value=Delete>
	<input type=hidden name=WEn value=$a1[WEn]>
	<input type=submit name=submit value=Edit>
	<input type=hidden name=WEn value=$a1[WEn]>
	</caption>
	</form>
	<tr>
		<td colspan=4><b>&nbsp; Position: </b> $a1[WE_p] </td>
	</tr>

	<tr>
		<td><b>&nbsp; From date</b></td>
		<td><b>&nbsp; To date</b></td>
	</tr>
	<tr>
		<td bgcolor=dddddd>&nbsp;$a1[WE_Start]</td>
		<td bgcolor=dddddd>&nbsp;$a1[WE_End]</td>
	</tr>
	<tr>
	<td colspan=4>
			<table cellspacing=0 width=100% class=BlackText>
			<tr>
			
			<td valign=top bgcolor=white>
			<b>&nbsp; Description: </b>
			</td>
			</tr>

			<tr>
			<td bgcolor=dddddd>
			$a1[WE_d] 
			</td>
			
			</tr>
			</table>
		</td>
	</td>
	</tr>
	</table>
	<br>
	<center><a href=EWAdd.php?WEn=$WEn class=BlackLink>Add another</a></center> 
	<br>
	
	<form method=POST action=ER4.php>
	<center><font size=3>Job Requirements</font></center><br><br><br>
	";
?>	
	&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
	&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
	Min. Annual Salary Requirement:
	<select name="income">
              <option value="Under 40,000" <? if($a2[income] == "Under 40,000") { echo "selected"; } ?>>Under 40,000</option>
              <option value="40,000-60,000" <? if($a2[income] == "40,000-60,000") { echo "selected"; } ?>>40,000-60,000</option>
              <option value="60,000-80,000" <? if($a2[income] == "60,000-80,000") { echo "selected"; } ?>>60,000-80,000</option>
              <option value="80,000-100,000" <? if($a2[income] == "80,000-100,000") { echo "selected"; } ?>>80,000-100,000</option>
              <option value="100,000-150,000" <? if($a2[income] == "100,000-150,000") { echo "selected"; } ?>>100,000-150,000</option>
              <option value="150,000-200,000" <? if($a2[income] == "150,000-200,000") { echo "selected"; } ?>>150,000-200,000</option>
              <option value="200,000 &and over" <? if($a2[income] == "200,000 &and over") { echo "selected"; } ?>>200,000 &and over</option>
            </select>
<br><br>
	&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
	&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
	Target Company:
	<select name="target_company">
<?

	foreach ($tarray1 AS $key => $value){
		if($value == $a2[target_company])
			{
?>
				<option value="<?=$value?>" selected><?=$value?></option>
<?
			}
			else
			{
?>
				<option value="<?=$value?>"><?=$value?></option>
<?
			}
		}
?>
	</select>
<br><br>
	&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
	&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
	Availability employment:
	<select name="employment">
              <option value="Immediately" <? if($a2[employment ] == "Immediately") { echo "selected"; } ?>>Immediately</option>
              <option value="1 month to 3 months" <? if($a2[employment ] == "1 month to 3 months") { echo "selected"; } ?>>1 month to 3 months</option>
              <option value="4 month to 7 months" <? if($a2[employment ] == "4 month to 7 months") { echo "selected"; } ?>>4 month to 7 months</option>
              <option value="8 month to 1 year" <? if($a2[employment ] == "8 month to 1 year") { echo "selected"; } ?>>8 month to 1 year</option>
              <option value="More than 1 year" <? if($a2[employment ] == "More than 1 year") { echo "selected"; } ?>>More than 1 year</option>
  </select>
<?
	echo"	
	<br><br>
	&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
	&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
	Job Category:<br><br>
	<table cellspacing=0 width=80% align=center class=BlackText>
	<tr>	
	";	

$c = 0;
$t = explode("|", $a2[job_category]);
foreach ($categories AS $key => $value){		
		if(in_array($value, $t)){
	echo"<td><input type='checkbox' name='job_category[]' value='$value' checked>$value</td>";
	}
	else{
	echo"<td><input type='checkbox' name='job_category[]' value='$value'>$value</td>";
	}
$c++;
		if($c==2){
			echo "</tr><tr>";
			$c = 0;
		}	
}
echo"</tr></table><br>";
}

$qs = "select count(WEn) from job_work_experience where uname = \"$_SESSION[uname]\" ";
$rqs = mysql_query($qs) or die(mysql_error());
$aqs = mysql_fetch_array($rqs);

$WEn = $aqs[0] + 1;
echo "<center><span class=TNA>
	
	<input type=submit name=s1 value='Go to Step 2 (Education)'>
        </span></center></form>";

?>

<? include_once('../footer.php'); ?>